import fetch from './config';
import ip from './ipConfig'
import {lc} from './../unit/index'
import {Toast,Indicator} from 'mint-ui';

export default {
  getUserInfo(params={}){
    //DONE:通过token获取用户信息  已搞定
      return fetch('GET',ip.JIp+'user/getUserInfoByToken', lc.dataConcat(params));
  },
  getMyLotteryBuyer(params={}){
    //DONE:获取我的彩民店主端  已搞定
    return fetch('GET',ip.JIp+'user/getMyLotteryBuyer', lc.dataConcat(params));
  },
  scanCodeBindForShop(params={}){
    //DONE:扫码绑定店主端  已搞定
    return fetch('POST',ip.JIp+'user/scanCodeBindForShop', lc.dataConcat(params));
  },
  list(params={}){
    return fetch('GET',ip.PIp+'?c=api_user&a=station_scheme&callType=JSON&type=1', lc.dataConcat(params));
  },
  getCaiminInfo(params){
    return fetch('GET',ip.PIp+'?c=api_user&a=getScheme_list&callType=JSON&rand=974743770&type=1', lc.dataConcat(params));
  },

  winDraw(params){
    return fetch('GET',ip.PIp+'?c=api_user&a=getTicket_bonus&callType=JSON', lc.dataConcat(params));
  },

  drawDetail(params){
    return fetch('GET',ip.PIp+'?c=api_user&a=getTicket_list&callType=JSON&type=0', lc.dataConcat(params));
  },

  winDetail(params){
    return fetch('GET',ip.PIp+'?c=api_user&a=getTicket_list&callType=JSON&type=1', lc.dataConcat(params));
  },

  orderDetail(params){
    return fetch('GET',ip.PIp+'?c=api_user&a=scheme_view&callType=JSON', lc.dataConcat(params));
  },
  changeStatus(params){
      return fetch('POST',ip.PIp+'?c=api_user&a=schemestatus_stations&callType=JSON&token='+sessionStorage.getItem('token'),lc.dataConcat(params));
  },
  returning(params){
      return fetch('POST',ip.PIp+'?c=api_user&a=back_bonus&callType=JSON&rand=974743770&token='+sessionStorage.getItem('token'),lc.dataConcat(params));
  },
    /*获取账户余额*/
  getBalance(params){
      return fetch('POST',ip.PIp+'?c=api_user&a=sale_total&callType=JSON&rand=974743770&token='+sessionStorage.getItem('token'),lc.dataConcat(params));
  },
  upLoad(params){
      return fetch('POST',ip.JIp+'userImage/createUserImageForPhp',lc.dataConcat(params));
  },
  delImg(params={}){
    return fetch('POST',ip.JIp+'userImage/deleteUserImageByImageTypeAndImageTypeObjectIdForPhp',lc.dataConcat(params));

  },
  createUserUrlByToken(params){
    //用户二维码上传
    return fetch('POST',ip.JIp+'userImage/createUserUrlByToken',lc.dataConcat(params));
  },
  checkUserOpenFinancialLendingPlatform(params){
    return fetch('POST',ip.JIp+'user/checkUserOpenFinancialLendingPlatform', lc.dataConcat(params));
  }

}

































